//
//  DemoRSSReaderViewController.m
//  DemoRSSReader
//
//  Created by Bruce McMoran on 7/16/11.
//  Copyright 2011 myself. All rights reserved.
//

#import "DemoRSSReaderViewController.h"
#import "FeedParser.h"

@implementation DemoRSSReaderViewController
@synthesize p;
- (void)dealloc
{
    [super dealloc];
    p = nil;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle


// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
    [super viewDidLoad];
    p = [[FeedParser alloc] initWithFeedURL:[NSURL URLWithString:@"http://feeds.feedburner.com/Pawesome"]];
    p.delegate = self;
    [p parse];
    // title
    // description
    // "more" -> content:encoded
    
    for (int i = 0; i < [p.feedItemsArray count]; i++) {
        NSLog(@"Item %d Title: %@",i, [[p.feedItemsArray objectAtIndex:i] objectForKey:@"title"]);
    }
    [p release];
    
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
